-
Notifications
You must be signed in to change notification settings - Fork 390
move giscus smoke tests to quarto-dev/quarto-cli #13319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
they just need a valid, giscus-enabled repo here
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
|
I must admit that I don't know either... I can't find back the CI log with the issue, and I can't reproduce anymore. So I don't know really what those tests do or why they would fail... 🤔 |
|
And I found back the error I have seen Oddly it was only on windows: https://github.com/quarto-dev/quarto-cli/actions/runs/17297423070/job/49174379603 It seems we call metadata for giscus from the repo in SO the smoke-all test may just test that this does not fail 🤷♂️ |
|
While doing the test with website:
comments:
giscus:
repo: allenmanning/giscus-exampleswe do get to quarto-cli/src/project/types/website/website-giscus.ts Lines 70 to 76 in 4bba7f4
but this fetch leads to error we don't even catch
We don't handle non configured repo at this stage Lines 32 to 41 in 4bba7f4
we probably should... 🤔 |
|
Maybe we could do diff --git a/src/core/giscus.ts b/src/core/giscus.ts
index add751582..1113f7e7e 100644
--- a/src/core/giscus.ts
+++ b/src/core/giscus.ts
@ -36,6 +35,11 @@ export async function getGithubDiscussionsMetadata(repo: string) {
// Fetch repo info
const response = await fetch(url);
+ if (!response.ok) {
+ throw new Error(
+ `Failed to fetch discussions metadata: ${response.statusText} from ${repo}. Check giscus repo setting, and check this repo is correctly configured with giscus.`,
+ );
+ }
const jsonObj = await response.json();
return jsonObj as GithubDiscussionMetadata;
}And then test an unconfigured repo to check it errors, and a configured repo to check it does not error and get the right content. Initially, the smoke-all tests were added for And maybe we do test giscus light / dark already, and better using playwright. I remember something like this... |
|
I see... I didn't realize there was a render-time fetch for giscus. That makes much more sense! And it was only failing for Windows, which explains why I was unable to repro locally. Okay, yeah this "fix" is inadequate and I agree we need better error handling to get consistent results. Now that I think of it, I'm actually not sure if Okay, I'll close this for now. Too much of a rabbit hole and I have slides to prepare. 😄 |
Ref #13298
These seem to be just smoke tests and they only need a valid, giscus-enabled repo.
I'm not clear how these are tested. The repo change in the configuration makes them preview ok!
PR to see if this clears CI.
Draft because I don't understand how this is tested!